﻿namespace System
{
    public static class DateTimeExtension
    {
        public static bool Between(this DateTime d, DateTime startTime, DateTime endTime)
        {
            if (startTime > endTime)
            {
                return d >= endTime && d <= startTime;
            }
            else
            {
                return d >= startTime && d <= endTime;
            }
        }
    }
}
